package Day22;

import java.util.Scanner;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-10-13
 * Time: 16:50
 * To BE A Better Person-2020-3-2
 */
public class TestDemo {
    public static int addmin(int a,int b){
        for (int i = Math.min(a,b); i > 0; i--) {
            if(a%i == 0 && b%i == 0){
                return i;
            }
        }
        return 1;
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
       // while(sc.hasNext()){
            //怪物数量
            int n=sc.nextInt();
            //初始能力值
            int a=sc.nextInt();
            //怪物能力值
            int[] monster=new int[n];
            for (int i = 0; i < n; i++) {
                monster[i]=sc.nextInt();
            }
            //开始打怪
            for (int i = 0; i < n; i++) {
                if(a >= monster[i] ){
                    a+=monster[i];
                }else{
                   a += addmin(a,monster[i]);
                }
            }
            System.out.println(a);
        }
    //}
}
